package com.weng.bigdata.core.mq.model;

import com.weng.bigdata.core.etl.enums.StreamsetsStatusEnum;
import com.weng.bigdata.core.schedule.TaskStatusEnum;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
* etl处理的状态变更 实体类
* @author wengzhonghui
* @date: 2021-07-03 08:56:41
*/
@Getter
@Setter
public class MqStreamsetsEtlStatus {

    private String pipelineId;
    private String fromState;
    private String toState;

    /**
     * 消息，如报错消息等
     */
    private String message;

    /**
     * 任务状态变更时间
     */
    private Date dateTime;

    @Override
    public String toString() {
        return "EtlStatusDto{" +
                "pipelineId='" + pipelineId + '\'' +
                ", fromState='" + fromState + '\'' +
                ", toState='" + toState + '\'' +
                ", message='" + message + '\'' +
                '}';
    }

    public static TaskStatusEnum getTaskStatusCode(Integer status) {
        return StreamsetsStatusEnum.getTaskStatusCode(status);
    }
}